package com.mygame.client;

import com.mygame.common.codec.DataCodecKit;
import com.mygame.common.msg.CommandEnum;
import com.mygame.common.protobuf.ExternalMessage;

public class ExtClientUtil {
    public static ExternalMessage buildMsg(CommandEnum commandEnum, Object obj) {
        ExternalMessage message = new ExternalMessage();
        message.setPlayerId(1);
        message.setData(DataCodecKit.encode(obj));
        message.setMessageId(commandEnum.id);
        message.setMessageType(1);
        message.setServiceId(commandEnum.service.id);
        return message;
    }
}
